home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / sendmail / sendmail-5.65c+IDA-1.4.4.1 / src / RCS / err.c,v < prev    next >
Encoding:
Text File  |  1991-06-25  |  17.8 KB  |  1,125 lines

  1. head    5.10;
  2. branch    5.10.0;
  3. access;
  4. symbols
  5.     RELEASE:5.10.0.11
  6.     BETA:5.10.0.10
  7.     UICSO:5.10.0
  8.     VANILLA:5.10;
  9. locks; strict;
  10. comment    @ * @;
  11.  
  12.  
  13. 5.10
  14. date    90.06.20.08.35.48;    author paul;    state Exp;
  15. branches
  16.     5.10.0.1;
  17. next    ;
  18.  
  19. 5.10.0.1
  20. date    90.10.25.09.13.17;    author paul;    state Exp;
  21. branches;
  22. next    5.10.0.2;
  23.  
  24. 5.10.0.2
  25. date    90.10.25.20.10.52;    author paul;    state Exp;
  26. branches;
  27. next    5.10.0.3;
  28.  
  29. 5.10.0.3
  30. date    90.11.07.13.53.44;    author paul;    state Exp;
  31. branches;
  32. next    5.10.0.4;
  33.  
  34. 5.10.0.4
  35. date    90.11.24.02.59.46;    author paul;    state Exp;
  36. branches;
  37. next    5.10.0.5;
  38.  
  39. 5.10.0.5
  40. date    90.11.26.20.41.21;    author paul;    state Exp;
  41. branches;
  42. next    5.10.0.6;
  43.  
  44. 5.10.0.6
  45. date    91.02.15.20.14.46;    author paul;    state Exp;
  46. branches;
  47. next    5.10.0.7;
  48.  
  49. 5.10.0.7
  50. date    91.03.04.21.48.23;    author paul;    state Exp;
  51. branches;
  52. next    5.10.0.8;
  53.  
  54. 5.10.0.8
  55. date    91.04.02.23.09.48;    author paul;    state Exp;
  56. branches;
  57. next    5.10.0.9;
  58.  
  59. 5.10.0.9
  60. date    91.04.05.14.55.15;    author paul;    state Exp;
  61. branches;
  62. next    5.10.0.10;
  63.  
  64. 5.10.0.10
  65. date    91.05.24.06.19.04;    author paul;    state Exp;
  66. branches;
  67. next    5.10.0.11;
  68.  
  69. 5.10.0.11
  70. date    91.06.21.12.47.57;    author paul;    state Exp;
  71. branches;
  72. next    ;
  73.  
  74.  
  75. desc
  76. @@
  77.  
  78.  
  79. 5.10
  80. log
  81. @5.64 Berkeley release
  82. @
  83. text
  84. @/*
  85.  * Copyright (c) 1983 Eric P. Allman
  86.  * Copyright (c) 1988 Regents of the University of California.
  87.  * All rights reserved.
  88.  *
  89.  * Redistribution and use in source and binary forms are permitted provided
  90.  * that: (1) source distributions retain this entire copyright notice and
  91.  * comment, and (2) distributions including binaries display the following
  92.  * acknowledgement:  ``This product includes software developed by the
  93.  * University of California, Berkeley and its contributors'' in the
  94.  * documentation or other materials provided with the distribution and in
  95.  * all advertising materials mentioning features or use of this software.
  96.  * Neither the name of the University nor the names of its contributors may
  97.  * be used to endorse or promote products derived from this software without
  98.  * specific prior written permission.
  99.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  100.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  101.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  102.  */
  103.  
  104. #ifndef lint
  105. static char sccsid[] = "@@(#)err.c    5.10 (Berkeley) 6/1/90";
  106. #endif /* not lint */
  107.  
  108. # include "sendmail.h"
  109. # include <errno.h>
  110. # include <netdb.h>
  111.  
  112. /*
  113. **  SYSERR -- Print error message.
  114. **
  115. **    Prints an error message via printf to the diagnostic
  116. **    output.  If LOG is defined, it logs it also.
  117. **
  118. **    Parameters:
  119. **        f -- the format string
  120. **        a, b, c, d, e -- parameters
  121. **
  122. **    Returns:
  123. **        none
  124. **        Through TopFrame if QuickAbort is set.
  125. **
  126. **    Side Effects:
  127. **        increments Errors.
  128. **        sets ExitStat.
  129. */
  130.  
  131. # ifdef lint
  132. int    sys_nerr;
  133. char    *sys_errlist[];
  134. # endif lint
  135. char    MsgBuf[BUFSIZ*2];    /* text of most recent message */
  136.  
  137. /*VARARGS1*/
  138. syserr(fmt, a, b, c, d, e)
  139.     char *fmt;
  140. {
  141.     register char *p;
  142.     int olderrno = errno;
  143.     extern char Arpa_PSyserr[];
  144.     extern char Arpa_TSyserr[];
  145.  
  146.     /* format and output the error message */
  147.     if (olderrno == 0)
  148.         p = Arpa_PSyserr;
  149.     else
  150.         p = Arpa_TSyserr;
  151.     fmtmsg(MsgBuf, (char *) NULL, p, olderrno, fmt, a, b, c, d, e);
  152.     puterrmsg(MsgBuf);
  153.  
  154.     /* determine exit status if not already set */
  155.     if (ExitStat == EX_OK)
  156.     {
  157.         if (olderrno == 0)
  158.             ExitStat = EX_SOFTWARE;
  159.         else
  160.             ExitStat = EX_OSERR;
  161.     }
  162.  
  163. # ifdef LOG
  164.     if (LogLevel > 0)
  165.         syslog(LOG_CRIT, "%s: SYSERR: %s",
  166.             CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
  167.             &MsgBuf[4]);
  168. # endif LOG
  169.     errno = 0;
  170.     if (QuickAbort)
  171.         longjmp(TopFrame, 2);
  172. }
  173. /*
  174. **  USRERR -- Signal user error.
  175. **
  176. **    This is much like syserr except it is for user errors.
  177. **
  178. **    Parameters:
  179. **        fmt, a, b, c, d -- printf strings
  180. **
  181. **    Returns:
  182. **        none
  183. **        Through TopFrame if QuickAbort is set.
  184. **
  185. **    Side Effects:
  186. **        increments Errors.
  187. */
  188.  
  189. /*VARARGS1*/
  190. usrerr(fmt, a, b, c, d, e)
  191.     char *fmt;
  192. {
  193.     extern char SuprErrs;
  194.     extern char Arpa_Usrerr[];
  195.     extern int errno;
  196.  
  197.     if (SuprErrs)
  198.         return;
  199.  
  200.     fmtmsg(MsgBuf, CurEnv->e_to, Arpa_Usrerr, errno, fmt, a, b, c, d, e);
  201.     puterrmsg(MsgBuf);
  202.  
  203.     if (QuickAbort)
  204.         longjmp(TopFrame, 1);
  205. }
  206. /*
  207. **  MESSAGE -- print message (not necessarily an error)
  208. **
  209. **    Parameters:
  210. **        num -- the default ARPANET error number (in ascii)
  211. **        msg -- the message (printf fmt) -- if it begins
  212. **            with a digit, this number overrides num.
  213. **        a, b, c, d, e -- printf arguments
  214. **
  215. **    Returns:
  216. **        none
  217. **
  218. **    Side Effects:
  219. **        none.
  220. */
  221.  
  222. /*VARARGS2*/
  223. message(num, msg, a, b, c, d, e)
  224.     register char *num;
  225.     register char *msg;
  226. {
  227.     errno = 0;
  228.     fmtmsg(MsgBuf, CurEnv->e_to, num, 0, msg, a, b, c, d, e);
  229.     putmsg(MsgBuf, FALSE);
  230. }
  231. /*
  232. **  NMESSAGE -- print message (not necessarily an error)
  233. **
  234. **    Just like "message" except it never puts the to... tag on.
  235. **
  236. **    Parameters:
  237. **        num -- the default ARPANET error number (in ascii)
  238. **        msg -- the message (printf fmt) -- if it begins
  239. **            with three digits, this number overrides num.
  240. **        a, b, c, d, e -- printf arguments
  241. **
  242. **    Returns:
  243. **        none
  244. **
  245. **    Side Effects:
  246. **        none.
  247. */
  248.  
  249. /*VARARGS2*/
  250. nmessage(num, msg, a, b, c, d, e)
  251.     register char *num;
  252.     register char *msg;
  253. {
  254.     errno = 0;
  255.     fmtmsg(MsgBuf, (char *) NULL, num, 0, msg, a, b, c, d, e);
  256.     putmsg(MsgBuf, FALSE);
  257. }
  258. /*
  259. **  PUTMSG -- output error message to transcript and channel
  260. **
  261. **    Parameters:
  262. **        msg -- message to output (in SMTP format).
  263. **        holdmsg -- if TRUE, don't output a copy of the message to
  264. **            our output channel.
  265. **
  266. **    Returns:
  267. **        none.
  268. **
  269. **    Side Effects:
  270. **        Outputs msg to the transcript.
  271. **        If appropriate, outputs it to the channel.
  272. **        Deletes SMTP reply code number as appropriate.
  273. */
  274.  
  275. putmsg(msg, holdmsg)
  276.     char *msg;
  277.     bool holdmsg;
  278. {
  279.     /* output to transcript if serious */
  280.     if (CurEnv->e_xfp != NULL && (msg[0] == '4' || msg[0] == '5'))
  281.         fprintf(CurEnv->e_xfp, "%s\n", msg);
  282.  
  283.     /* output to channel if appropriate */
  284.     if (!holdmsg && (Verbose || msg[0] != '0'))
  285.     {
  286.         (void) fflush(stdout);
  287.         if (OpMode == MD_SMTP || OpMode == MD_ARPAFTP)
  288.             fprintf(OutChannel, "%s\r\n", msg);
  289.         else
  290.             fprintf(OutChannel, "%s\n", &msg[4]);
  291.         (void) fflush(OutChannel);
  292.     }
  293. }
  294. /*
  295. **  PUTERRMSG -- like putmsg, but does special processing for error messages
  296. **
  297. **    Parameters:
  298. **        msg -- the message to output.
  299. **
  300. **    Returns:
  301. **        none.
  302. **
  303. **    Side Effects:
  304. **        Sets the fatal error bit in the envelope as appropriate.
  305. */
  306.  
  307. puterrmsg(msg)
  308.     char *msg;
  309. {
  310.     /* output the message as usual */
  311.     putmsg(msg, HoldErrs);
  312.  
  313.     /* signal the error */
  314.     Errors++;
  315.     if (msg[0] == '5')
  316.         CurEnv->e_flags |= EF_FATALERRS;
  317. }
  318. /*
  319. **  FMTMSG -- format a message into buffer.
  320. **
  321. **    Parameters:
  322. **        eb -- error buffer to get result.
  323. **        to -- the recipient tag for this message.
  324. **        num -- arpanet error number.
  325. **        en -- the error number to display.
  326. **        fmt -- format of string.
  327. **        a, b, c, d, e -- arguments.
  328. **
  329. **    Returns:
  330. **        none.
  331. **
  332. **    Side Effects:
  333. **        none.
  334. */
  335.  
  336. /*VARARGS5*/
  337. static
  338. fmtmsg(eb, to, num, eno, fmt, a, b, c, d, e)
  339.     register char *eb;
  340.     char *to;
  341.     char *num;
  342.     int eno;
  343.     char *fmt;
  344. {
  345.     char del;
  346.  
  347.     /* output the reply code */
  348.     if (isdigit(fmt[0]) && isdigit(fmt[1]) && isdigit(fmt[2]))
  349.     {
  350.         num = fmt;
  351.         fmt += 4;
  352.     }
  353.     if (num[3] == '-')
  354.         del = '-';
  355.     else
  356.         del = ' ';
  357.     (void) sprintf(eb, "%3.3s%c", num, del);
  358.     eb += 4;
  359.  
  360.     /* output the file name and line number */
  361.     if (FileName != NULL)
  362.     {
  363.         (void) sprintf(eb, "%s: line %d: ", FileName, LineNumber);
  364.         eb += strlen(eb);
  365.     }
  366.  
  367.     /* output the "to" person */
  368.     if (to != NULL && to[0] != '\0')
  369.     {
  370.         (void) sprintf(eb, "%s... ", to);
  371.         while (*eb != '\0')
  372.             *eb++ &= 0177;
  373.     }
  374.  
  375.     /* output the message */
  376.     (void) sprintf(eb, fmt, a, b, c, d, e);
  377.     while (*eb != '\0')
  378.         *eb++ &= 0177;
  379.  
  380.     /* output the error code, if any */
  381.     if (eno != 0)
  382.     {
  383.         extern char *errstring();
  384.  
  385.         (void) sprintf(eb, ": %s", errstring(eno));
  386.         eb += strlen(eb);
  387.     }
  388. }
  389. /*
  390. **  ERRSTRING -- return string description of error code
  391. **
  392. **    Parameters:
  393. **        errno -- the error number to translate
  394. **
  395. **    Returns:
  396. **        A string description of errno.
  397. **
  398. **    Side Effects:
  399. **        none.
  400. */
  401.  
  402. char *
  403. errstring(errno)
  404.     int errno;
  405. {
  406.     extern char *sys_errlist[];
  407.     extern int sys_nerr;
  408.     static char buf[100];
  409. # ifdef SMTP
  410.     extern char *SmtpPhase;
  411. # endif SMTP
  412.  
  413. # ifdef DAEMON
  414. # ifdef VMUNIX
  415.     /*
  416.     **  Handle special network error codes.
  417.     **
  418.     **    These are 4.2/4.3bsd specific; they should be in daemon.c.
  419.     */
  420.  
  421.     switch (errno)
  422.     {
  423.       case ETIMEDOUT:
  424.       case ECONNRESET:
  425.         (void) strcpy(buf, sys_errlist[errno]);
  426.         if (SmtpPhase != NULL)
  427.         {
  428.             (void) strcat(buf, " during ");
  429.             (void) strcat(buf, SmtpPhase);
  430.         }
  431.         if (CurHostName != NULL)
  432.         {
  433.             (void) strcat(buf, " with ");
  434.             (void) strcat(buf, CurHostName);
  435.         }
  436.         return (buf);
  437.  
  438.       case EHOSTDOWN:
  439.         if (CurHostName == NULL)
  440.             break;
  441.         (void) sprintf(buf, "Host %s is down", CurHostName);
  442.         return (buf);
  443.  
  444.       case ECONNREFUSED:
  445.         if (CurHostName == NULL)
  446.             break;
  447.         (void) sprintf(buf, "Connection refused by %s", CurHostName);
  448.         return (buf);
  449.  
  450.       case (TRY_AGAIN+MAX_ERRNO):
  451.         (void) sprintf(buf, "Host Name Lookup Failure");
  452.         return (buf);
  453.     }
  454. # endif VMUNIX
  455. # endif DAEMON
  456.  
  457.     if (errno > 0 && errno < sys_nerr)
  458.         return (sys_errlist[errno]);
  459.  
  460.     (void) sprintf(buf, "Error %d", errno);
  461.     return (buf);
  462. }
  463. @
  464.  
  465.  
  466. 5.10.0.1
  467. log
  468. @Bruce Lilly (bruce%balilly@@sonyd1.broadcast.sony.com) varargs code changes
  469. adapted to key off #define VSPRINTF in conf.h.
  470. @
  471. text
  472. @d25 3
  473. a27 3
  474. #include "sendmail.h"
  475. #include <errno.h>
  476. #include <netdb.h>
  477. d36 1
  478. a36 1
  479. **        fmt -- the format string
  480. d48 1
  481. a48 1
  482. #ifdef lint
  483. d51 1
  484. a51 1
  485. #endif /* lint */
  486. a54 8
  487. #ifdef VSPRINTF
  488. syserr(va_alist)
  489. va_dcl
  490. {
  491.     va_list    ap;
  492.     char    *fmt;
  493.     char    buf[BUFSIZ*2];
  494. #else /* !VSPRINTF */
  495. a57 1
  496. #endif /* VSPRINTF */
  497. a61 1
  498.     static fmtmsg();
  499. a67 7
  500. #ifdef VSPRINTF
  501.     va_start(ap);
  502.     fmt = va_arg(ap, char *);
  503.     (void) vsprintf(buf, fmt, ap);
  504.     fmtmsg(MsgBuf, (char *) NULL, p, olderrno, buf);
  505.     va_end(ap);
  506. #else /* !VSPRINTF */
  507. a68 1
  508. #endif /* VSPRINTF */
  509. d80 1
  510. a80 1
  511. #ifdef LOG
  512. d85 1
  513. a85 1
  514. #endif /* LOG */
  515. a106 8
  516. #ifdef VSPRINTF
  517. usrerr(va_alist)
  518. va_dcl
  519. {
  520.     va_list    ap;
  521.     char    *fmt;
  522.      char    buf[BUFSIZ*2];
  523. #else /* !VSPRINTF */
  524. a109 1
  525. #endif /* VSPRINTF */
  526. a112 1
  527.     static fmtmsg();
  528. a116 7
  529. #ifdef VSPRINTF
  530.     va_start(ap);
  531.     fmt = va_arg(ap, char *);
  532.     (void) vsprintf(buf, fmt, ap);
  533.     fmtmsg(MsgBuf, CurEnv->e_to, Arpa_Usrerr, errno, buf);
  534.     va_end(ap);
  535. #else /* !VSPRINTF */
  536. a117 1
  537. #endif /* VSPRINTF */
  538. a139 22
  539. #ifdef VSPRINTF
  540. void
  541. message(va_alist)
  542. va_dcl
  543. {
  544.     va_list    ap;
  545.       register char *num;
  546.       register char *msg;
  547.     char    buf[BUFSIZ*2];
  548.     static fmtmsg();
  549.  
  550.     errno = 0;
  551.     va_start(ap);
  552.     num = va_arg(ap, char *);
  553.     msg = va_arg(ap, char *);
  554.     (void) vsprintf(buf, msg, ap);
  555.     fmtmsg(MsgBuf, CurEnv->e_to, num, 0, buf);
  556.     va_end(ap);
  557.     putmsg(MsgBuf, FALSE);
  558. }
  559. #else /* !VSPRINTF */
  560. void
  561. a143 2
  562.     static fmtmsg();
  563.  
  564. a147 1
  565. #endif /* VSPRINTF */
  566. a166 20
  567. #ifdef VSPRINTF
  568. nmessage(va_alist)
  569. va_dcl
  570. {
  571.     va_list    ap;
  572.       register char *num;
  573.       register char *msg;
  574.     char    buf[BUFSIZ*2];
  575.     static fmtmsg();
  576.  
  577.     errno = 0;
  578.     va_start(ap);
  579.     num = va_arg(ap, char *);
  580.     msg = va_arg(ap, char *);
  581.     (void) vsprintf(buf, msg, ap);
  582.     fmtmsg(MsgBuf, (char *) NULL, num, 0, buf);
  583.     va_end(ap);
  584.     putmsg(MsgBuf, FALSE);
  585. }
  586. #else /* !VSPRINTF */
  587. a170 2
  588.     static fmtmsg();
  589.  
  590. a174 1
  591. #endif /* VSPRINTF */
  592. a254 19
  593. #ifdef VSPRINTF
  594. fmtmsg(va_alist)
  595. va_dcl
  596. {
  597.     va_list    ap;
  598.     register char *eb;
  599.     char *to;
  600.     char *num;
  601.     int eno;
  602.     char *fmt;
  603.     char del;
  604.  
  605.     va_start(ap);
  606.     eb = va_arg(ap, char *);
  607.     to = va_arg(ap, char *);
  608.     num = va_arg(ap, char *);
  609.     eno = va_arg(ap, int);
  610.     fmt = va_arg(ap, char *);
  611. #else /* !VSPRINTF */
  612. a262 1
  613. #endif /* VSPRINTF */
  614. a292 4
  615. #ifdef VSPRINTF
  616.     (void) sprintf(eb, fmt, ap);
  617.     va_end(ap);
  618. #else /* !VSPRINTF */
  619. a293 1
  620. #endif /* VSPRINTF */
  621. d326 1
  622. a326 1
  623. #ifdef SMTP
  624. d328 1
  625. a328 1
  626. #endif /* SMTP */
  627. d330 2
  628. a331 1
  629. #if defined(DAEMON) && defined(VMUNIX)
  630. a366 1
  631. # ifdef NAMED_BIND
  632. a369 1
  633. # endif /* NAMED_BIND */
  634. d371 2
  635. a372 1
  636. #endif /* VMUNIX && DAEMON */
  637. @
  638.  
  639.  
  640. 5.10.0.2
  641. log
  642. @Correct bug with fmtmsg() being handed a fmt string with %-hack addresses in
  643. it and #define VSPRINTF.  Reported by Steve Emmerson (steve@@unidata.ucar.edu).
  644. @
  645. text
  646. @d61 1
  647. d81 2
  648. a82 1
  649.     fmtmsg(MsgBuf, (char *) NULL, p, olderrno, fmt, ap);
  650. d131 1
  651. d148 2
  652. a149 1
  653.     fmtmsg(MsgBuf, CurEnv->e_to, Arpa_Usrerr, errno, fmt, ap);
  654. d191 2
  655. a192 1
  656.     fmtmsg(MsgBuf, CurEnv->e_to, num, 0, msg, ap);
  657. d235 1
  658. d242 2
  659. a243 1
  660.     fmtmsg(MsgBuf, (char *) NULL, num, 0, msg, ap);
  661. d328 1
  662. a328 2
  663. **        ap -- varargs pointer #ifdef VSPRINTF
  664. **        a, b, c, d, e -- arguments.  #ifndef VSPRINTF
  665. d340 17
  666. a356 2
  667. fmtmsg(eb, to, num, eno, fmt, ap)
  668.     va_list ap;
  669. a358 1
  670. #endif /* VSPRINTF */
  671. d366 1
  672. d398 2
  673. a399 1
  674.     (void) vsprintf(eb, fmt, ap);
  675. @
  676.  
  677.  
  678. 5.10.0.3
  679. log
  680. @More declarations to keep gcc happy.
  681. @
  682. text
  683. @d54 1
  684. a55 1
  685. /*VARARGS*/
  686. a61 1
  687. /*VARARGS1*/
  688. d70 1
  689. a70 1
  690.     static fmtmsg(), puterrmsg();
  691. d122 1
  692. a123 1
  693. /*VARARGS*/
  694. a129 1
  695. /*VARARGS1*/
  696. d137 1
  697. a137 1
  698.     static fmtmsg(), puterrmsg();
  699. d171 1
  700. a172 1
  701. /*VARARGS*/
  702. d180 2
  703. a181 1
  704.     static fmtmsg(), putmsg();
  705. a191 1
  706. /*VARARGS2*/
  707. d197 1
  708. a197 1
  709.     static fmtmsg(), putmsg();
  710. d222 1
  711. a223 2
  712. /*VARARGS*/
  713. void
  714. d230 1
  715. a230 1
  716.     static fmtmsg(), putmsg();
  717. a240 2
  718. /*VARARGS2*/
  719. void
  720. d245 1
  721. a245 1
  722.     static fmtmsg(), putmsg();
  723. a268 1
  724. static
  725. a300 1
  726. static
  727. a303 2
  728.     static putmsg();
  729.  
  730. @
  731.  
  732.  
  733. 5.10.0.4
  734. log
  735. @Corrected forward declarations of putmsg(), fmtmsg(), puterrmsg().
  736. @
  737. text
  738. @a28 1
  739. void fmtmsg(), putmsg(), puterrmsg();
  740. d71 1
  741. d139 1
  742. d182 1
  743. d199 2
  744. d233 1
  745. d250 2
  746. d274 1
  747. a274 1
  748. static void
  749. d307 1
  750. a307 1
  751. static void
  752. d311 2
  753. d341 1
  754. a341 1
  755. static void
  756. @
  757.  
  758.  
  759. 5.10.0.5
  760. log
  761. @Commented out un-needed assignment.
  762. @
  763. text
  764. @d390 1
  765. a390 1
  766.         /* eb += strlen(eb); un-used  -pbp */
  767. @
  768.  
  769.  
  770. 5.10.0.6
  771. log
  772. @Cast some more functions to void.
  773. @
  774. text
  775. @a56 1
  776. void
  777. a63 1
  778. void
  779. a124 1
  780. void
  781. a131 1
  782. void
  783. @
  784.  
  785.  
  786. 5.10.0.7
  787. log
  788. @ANSIfied.
  789. @
  790. text
  791. @d29 1
  792. a29 14
  793. #ifdef __STDC__
  794. static void putmsg(const char *, int);        /* bool -> int */
  795. static void puterrmsg(const char *);
  796. # ifndef VSPRINTF
  797. static void fmtmsg();
  798. # else /* VSPRINTF */
  799. static void fmtmsg(char *, const char *, const char *, int, const char *, va_list);
  800. # endif /* !VSPRINTF */
  801. #else /* !__STDC__ */
  802. static void putmsg();
  803. static void puterrmsg();
  804. static void fmtmsg();
  805. #endif /* __STDC__ */
  806.  
  807. d58 1
  808. a58 2
  809. syserr(fmt, va_alist)
  810.     const char *fmt;
  811. d62 1
  812. d67 1
  813. a67 1
  814.     const char *fmt;
  815. d82 1
  816. d128 1
  817. a128 2
  818. usrerr(fmt, va_alist)
  819.     const char *fmt;
  820. d132 1
  821. d137 1
  822. a137 1
  823.     const char *fmt;
  824. d140 1
  825. d149 1
  826. d179 1
  827. a179 3
  828. message(num, msg, va_alist)
  829.     register const char *num;
  830.     register const char *msg;
  831. d183 2
  832. d188 2
  833. d198 2
  834. a199 2
  835.     register const char *num;
  836.     register const char *msg;
  837. d227 1
  838. a227 3
  839. nmessage(num, msg, va_alist)
  840.     register const char *num;
  841.     register const char *msg;
  842. d231 2
  843. d236 2
  844. d246 2
  845. a247 2
  846.     register const char *num;
  847.     register const char *msg;
  848. d273 1
  849. a273 1
  850.     const char *msg;
  851. d306 1
  852. a306 1
  853.     const char *msg;
  854. d344 2
  855. a345 1
  856.     const char *to, *num, *fmt;
  857. d347 1
  858. @
  859.  
  860.  
  861. 5.10.0.8
  862. log
  863. @Use stdarg instead of varargs when __STDC__ && VSPRINTF are true.
  864. @
  865. text
  866. @d30 1
  867. a30 1
  868. static void putmsg(const char *, int);
  869. a67 1
  870. /*VARARGS1*/
  871. d69 1
  872. a69 4
  873. # ifdef __STDC__
  874. void
  875. syserr(const char *fmt, ...)
  876. # else /* !__STDC__ */
  877. a73 1
  878. # endif /* __STDC__ */
  879. d75 1
  880. a75 1
  881.     va_list    args;
  882. d77 1
  883. d83 1
  884. a83 1
  885.     char *p;
  886. d94 3
  887. a96 7
  888. # ifdef __STDC__
  889.     va_start(args, fmt);
  890. # else /* !__STDC__ */
  891.     va_start(args);
  892. # endif /* __STDC__ */
  893.     fmtmsg(MsgBuf, (char *) NULL, p, olderrno, fmt, args);
  894.     va_end(args);
  895. a136 1
  896. /*VARARGS1*/
  897. d138 1
  898. a138 1
  899. # ifdef __STDC__
  900. a139 3
  901. usrerr(const char *fmt, ...)
  902. # else /* !__STDC__ */
  903. void
  904. a142 1
  905. # endif /* __STDC__ */
  906. d144 1
  907. a144 1
  908.     va_list    args;
  909. d146 1
  910. d159 3
  911. a161 7
  912. # ifdef __STDC__
  913.     va_start(args, fmt);
  914. # else /* !__STDC__ */
  915.     va_start(args);
  916. # endif /* __STDC__ */
  917.     fmtmsg(MsgBuf, CurEnv->e_to, Arpa_Usrerr, errno, fmt, args);
  918.     va_end(args);
  919. a185 1
  920. /*VARARGS2*/
  921. d187 1
  922. a187 4
  923. # ifdef __STDC__
  924. void
  925. message(const char *num, const char *msg, ...)
  926. # else /* !__STDC__ */
  927. d190 2
  928. a191 2
  929.     const char *num;
  930.     const char *msg;
  931. a192 1
  932. # endif /* __STDC__ */
  933. d194 1
  934. a194 1
  935.     va_list    args;
  936. d197 3
  937. a199 7
  938. # ifdef __STDC__
  939.     va_start(args, msg);
  940. # else /* !__STDC__ */
  941.     va_start(args);
  942. # endif /* __STDC__ */
  943.     fmtmsg(MsgBuf, CurEnv->e_to, num, 0, msg, args);
  944.     va_end(args);
  945. d203 1
  946. d206 2
  947. a207 2
  948.     const char *num;
  949.     const char *msg;
  950. a231 1
  951. /*VARARGS2*/
  952. d233 1
  953. a233 1
  954. # ifdef __STDC__
  955. a234 3
  956. nmessage(const char *num, const char *msg, ...)
  957. # else /* !__STDC__ */
  958. void
  959. d236 2
  960. a237 2
  961.     const char *num;
  962.     const char *msg;
  963. a238 1
  964. # endif /* __STDC__ */
  965. d240 1
  966. a240 1
  967.     va_list    args;
  968. d243 3
  969. a245 7
  970. # ifdef __STDC__
  971.     va_start(args, msg);
  972. # else /* !__STDC__ */
  973.     va_start(args);
  974. # endif /* __STDC__ */
  975.     fmtmsg(MsgBuf, (char *) NULL, num, 0, msg, args);
  976.     va_end(args);
  977. d249 1
  978. d252 2
  979. a253 2
  980.     const char *num;
  981.     const char *msg;
  982. d331 1
  983. a331 1
  984. **        args -- varargs pointer #ifdef VSPRINTF
  985. d344 2
  986. a345 2
  987. fmtmsg(eb, to, num, eno, fmt, args)
  988.     va_list args;
  989. d349 1
  990. a349 1
  991.     char *eb;
  992. d385 1
  993. a385 1
  994.     (void) vsprintf(eb, fmt, args);
  995. @
  996.  
  997.  
  998. 5.10.0.9
  999. log
  1000. @Added RCS ID string
  1001. @
  1002. text
  1003. @a22 1
  1004. static char  rcsid[] = "@@(#)$Id$";
  1005. @
  1006.  
  1007.  
  1008. 5.10.0.10
  1009. log
  1010. @Eliminated code sections used when VSPRINTF was undefined.  A portable
  1011. vsprintf() is now included.
  1012. @
  1013. text
  1014. @d23 1
  1015. a23 1
  1016. static char  rcsid[] = "@@(#)$Id: err.c,v 5.10.0.10 1991/05/22 02:30:43 paul Exp $";
  1017. d33 3
  1018. d37 1
  1019. d70 2
  1020. a71 1
  1021. #ifdef __STDC__
  1022. d74 1
  1023. a74 1
  1024. #else /* !__STDC__ */
  1025. d79 1
  1026. a79 1
  1027. #endif /* __STDC__ */
  1028. d82 6
  1029. d98 2
  1030. a99 1
  1031. #ifdef __STDC__
  1032. d101 1
  1033. a101 1
  1034. #else /* !__STDC__ */
  1035. d103 1
  1036. a103 1
  1037. #endif /* __STDC__ */
  1038. d106 3
  1039. d147 2
  1040. a148 1
  1041. #ifdef __STDC__
  1042. d151 1
  1043. a151 1
  1044. #else /* !__STDC__ */
  1045. d156 1
  1046. a156 1
  1047. #endif /* __STDC__ */
  1048. d159 6
  1049. d171 2
  1050. a172 1
  1051. #ifdef __STDC__
  1052. d174 1
  1053. a174 1
  1054. #else /* !__STDC__ */
  1055. d176 1
  1056. a176 1
  1057. #endif /* __STDC__ */
  1058. d179 3
  1059. d204 2
  1060. a205 1
  1061. #ifdef __STDC__
  1062. d208 1
  1063. a208 1
  1064. #else /* !__STDC__ */
  1065. d214 1
  1066. a214 1
  1067. #endif /* __STDC__ */
  1068. d219 1
  1069. a219 1
  1070. #ifdef __STDC__
  1071. d221 1
  1072. a221 1
  1073. #else /* !__STDC__ */
  1074. d223 1
  1075. a223 1
  1076. #endif /* __STDC__ */
  1077. d228 11
  1078. d258 2
  1079. a259 1
  1080. #ifdef __STDC__
  1081. d262 1
  1082. a262 1
  1083. #else /* !__STDC__ */
  1084. d268 1
  1085. a268 1
  1086. #endif /* __STDC__ */
  1087. d273 1
  1088. a273 1
  1089. #ifdef __STDC__
  1090. d275 1
  1091. a275 1
  1092. #else /* !__STDC__ */
  1093. d277 1
  1094. a277 1
  1095. #endif /* __STDC__ */
  1096. d282 11
  1097. d364 2
  1098. a365 1
  1099. **        args -- varargs pointer
  1100. d376 1
  1101. d378 4
  1102. a384 1
  1103.     va_list args;
  1104. d417 1
  1105. d419 3
  1106. @
  1107.  
  1108.  
  1109. 5.10.0.11
  1110. log
  1111. @Fixes to use of VMUNIX and DAEMON from Bruce Lilly.
  1112. @
  1113. text
  1114. @d23 1
  1115. a23 1
  1116. static char  rcsid[] = "@@(#)$Id: err.c,v 5.10.0.10 1991/05/24 06:19:04 paul Exp paul $";
  1117. d368 3
  1118. d372 2
  1119. d395 1
  1120. a395 1
  1121. #if defined(DAEMON) && defined(VMUNIX)
  1122. d397 1
  1123. d399 1
  1124. @
  1125.